import time
f = open("m1_sorted.txt")
start = time.time()
sp = list(map(int, f.readlines()))
while True:
    fl = 1
    for i in range(0, len (sp)-1):
        if sp[i] > sp[i+1]:
            fl = 0
            a = sp[i]
            sp[i] = sp[i+1]
            sp[i+1] = a
    if fl == 1:
        break
end = time.time()
print("m1_sorted", round((end-start)*1000), "milliseconds")


import time
f = open("m2_reverse.txt")
start = time.time()
sp = list(map(int, f.readlines()))
while True:
    fl = 1
    for i in range(0, len (sp)-1):
        if sp[i] > sp[i+1]:
            fl = 0
            a = sp[i]
            sp[i] = sp[i+1]
            sp[i+1] = a
    if fl == 1:
        break
end = time.time()
print( "m2_reverse", round((end-start)*1000), "milliseconds")


import time
f = open("m3_shuffle.txt")
start = time.time()
sp = list(map(int, f.readlines()))
while True:
    fl = 1
    for i in range(0, len(sp) - 1):
        if sp[i] > sp[i + 1]:
            fl = 0
            a = sp[i]
            sp[i] = sp[i + 1]
            sp[i + 1] = a
    if fl == 1:
        break
end = time.time()
print("m3_shuffle", round((end - start) * 1000), "milliseconds")
